//
//  YMComposeButton.swift
//  YMWeiBo
//
//  Created by mimi on 16/7/28.
//  Copyright © 2016年 mimi. All rights reserved.
//

import UIKit

class YMComposeButton: UIButton {
    
    var composeButtonInfo:YMComposeButtonInfos?
    
    
    
    
    
    
    // 干掉按钮高亮效果
    override var highlighted: Bool{
        get{
            return false
        }
        
        set{
            
        }
    }

    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func setupUI() {
        
        //在设置imageView
        imageView?.contentMode = .Center
        //设置Title
        titleLabel?.textAlignment = .Center
        titleLabel?.font = UIFont.systemFontOfSize(15)
        setTitleColor(UIColor.darkGrayColor(), forState: .Normal)
        
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        imageView?.frame = CGRectMake(0, 0, self.frame.width, self.frame.width)
        
        titleLabel?.frame = CGRectMake(0, self.frame.width, self.frame.width, self.frame.height - self.frame.width)
    }
    
}
